"""
添加成员
"""
import allure
from appium.webdriver.common.appiumby import AppiumBy

from wework_frame.base.wework_app import WeWorkApp
from wework_frame.page.input_page import InputPage


class AddMemberPage(WeWorkApp):
    __MENUAL_INPUT_VTN = AppiumBy.XPATH, "//*[@text='手动输入添加']"

    @allure.step("点击手动输入添加按钮，跳转到添加页面")
    def goto_input_page(self):
        # self.driver.find_element(AppiumBy.XPATH, "//*[@text='手动输入添加']").click()
        self.find_and_click(*self.__MENUAL_INPUT_VTN)
        return InputPage(self.driver)

    @allure.step("获取toast信息")
    def get_tips(self):
        '''
        获取toast
        :return:
        '''
        # toast_tips = self.driver.find_element(AppiumBy.XPATH, "//*[@class='android.widget.Toast']").text
        toast_tips = self.get_toast_tips()
        return toast_tips
